import React, { PureComponent } from 'react';
import { connect } from 'dva';
import QuestionSetting from './QuestionSetting';
import PaperItem from './PaperItem';
import { Card, Row, Input, Button, Col, Checkbox, Icon, Upload, Divider, Form, Radio } from 'antd';

@connect(({ paper }) => ({

}))
class SimpleSelectionPage extends PureComponent {

  constructor(...args) {
    super(...args);
    this.state = {
      display: true,
    };
  }

  hideConponent = () => {
    this.setState({
      display: true,
    });
  }

  showConponent = () => {
    this.setState({
      display: false,
    });
  }

  render() {
    const { display } = this.state;
    const { question } = this.props;
    // console.log("props",this.props)
    // console.log("state",this.state)
    return (
      <div style={{width:`100%`}}>
        {
          display ? <PaperItem question={question} showConponent={this.showConponent} /> 
          : <QuestionSetting hideConponent={this.hideConponent} question={question} />
        }
      </div>
    )
  }
}
export default SimpleSelectionPage